package algorithm.poj.p1000;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLDecoder;

/**
 * 分析：
 * C(m+n, m)
 * 
 * 实现：
 * 
 * 经验：
 * 
 * 教训：
 * 
 * 
 * @author wong.tong@gmail.com
 *
 */
public class P1942 {

	public static void main(String[] args) throws Exception {

		InputStream input = null;
		if (false) {
			input = System.in;
		} else {
			URL url = P1942.class.getResource("P1942.txt");
			File file = new File(URLDecoder.decode(url.getPath(), "UTF-8"));
			input = new FileInputStream(file);
		}
		
		BufferedReader stdin = new BufferedReader(new InputStreamReader(input));

		String line = stdin.readLine();
		while (line != null && !"0 0".equals(line.trim())) {
			String[] tmp = line.trim().split(" ");
			long m = Long.valueOf(tmp[0]);
			long n = Long.valueOf(tmp[1]);
			long r = 1;
			for (long i = 0; i < (long)Math.min(m, n); i ++) {
				r = r*(m+n-i)/(i+1);
			}
			System.out.println(r);
			line = stdin.readLine();
		}
	}
}